<template>
  <el-menu 
      :style="{ width:!store.state.isCollapse ?  '230px' : '64px' }" 
      active-text-color="#ffd04b" 
      background-color="#545c64" 
      class="aside-cont"
      text-color="#fff" 
      @open="handleOpen" 
      @close="handleClose"
      :collapse="store.state.isCollapse"
      :default-active="store.state.menuActive"
      >
    <p class="login-lg">{{!store.state.isCollapse ?  'DIDI陪诊' : 'DIDI' }}</p>
    <threeMenu :index="1" :menuData="menuData" />
  </el-menu>
</template>

<script setup lang="ts">
import threeMenu from './threeMenu.vue'
// 创建响应式数组
import { reactive } from 'vue'

// 获取pinia中的是数据
import { CounterStore } from '../store/index'
const store = CounterStore();

// const router = useRouter()
// const menuData = reactive(router.options.routes[0].children || [])
//更换为动态路由
const menuData = reactive(store.state.routerList || [])

const handleOpen = () => { }
const handleClose = () => { }
</script>

<style scoped lang="less">
.aside-cont {
  height: 100%;

  .login-lg {
    font-size: 20px;
    line-height: 50px;
    color: #fff;
    text-align: center;
  }
}
</style>